//
//  PeopleCollectionViewCell.m
//  ThePrivateKitchen
//
//  Created by lirui on 16/1/20.
//  Copyright © 2016年 www.lanou3g.com蓝鸥科技. All rights reserved.
//

#import "PeopleCollectionViewCell.h"

@implementation PeopleCollectionViewCell

- (void)dealloc
{
    [_img release];
    [_name release];
    [_fans release];
    [super dealloc];
}
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        //imgview
        self.img = [[ UIImageView alloc] init];
        // _imgview.backgroundColor = [ UIColor redColor];
        [self.contentView addSubview:_img];
       _img .layer.cornerRadius = 63.75 / 2;
        _img.clipsToBounds = YES;
        [_img release];
        //titlel
        self.name =[[  UILabel alloc] init];
        // _title.backgroundColor = [ UIColor greenColor];
        [self.contentView addSubview:_name];
        [_name release];
        _name.font =[ UIFont systemFontOfSize:13];
        _name.textAlignment = NSTextAlignmentCenter;
        self.fans = [[ UILabel alloc] init];
        [self.contentView addSubview:_fans];
        [_fans release];
        _fans.font = [ UIFont systemFontOfSize:10];
        _fans.textAlignment= NSTextAlignmentCenter;
        
    }
    return self;
}

- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    _img.frame = CGRectMake(0, 0,layoutAttributes.size.width - 20, layoutAttributes.size.height );
    _name.frame = CGRectMake(0, layoutAttributes.size.height , layoutAttributes.size.width -20, 20);
    _fans.frame = CGRectMake(0,layoutAttributes.size.height+15  , layoutAttributes.size.width -20, 20) ;
}
@end
